
package com.netease.xone.test;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.netease.xone.R;

public class FakeBannerInfo implements IBannerInfo {

    private String title;
    private Bitmap img;

    @Override
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public Bitmap getImg() {
        return img;
    }

    public void setImg(Bitmap img) {
        this.img = img;
    }

    public static List<IBannerInfo> createInfos(Context context) {
        List<IBannerInfo> list = new ArrayList<IBannerInfo>();
        FakeBannerInfo info = new FakeBannerInfo();
        info.setImg(BitmapFactory.decodeResource(context.getResources(), R.drawable.banner_img_1));
        info.setTitle("Banner 1");
        list.add(info);
        info = new FakeBannerInfo();
        info.setImg(BitmapFactory.decodeResource(context.getResources(), R.drawable.banner_img_2));
        info.setTitle("Banner 2");
        list.add(info);
        info = new FakeBannerInfo();
        info.setImg(BitmapFactory.decodeResource(context.getResources(), R.drawable.banner_img_3));
        info.setTitle("Banner 3");
        list.add(info);
        info = new FakeBannerInfo();
        info.setImg(BitmapFactory.decodeResource(context.getResources(), R.drawable.banner_img_4));
        info.setTitle("Banner 4");
        list.add(info);

        return list;
    }

    @Override
    public void clear() {
        title = null;
        img = null;
    }
}
